#include <header.h>

int main(){
    struct addrinfo *res;
    getaddrinfo("www.baidu.com",NULL,NULL,&res);
    for(struct addrinfo *p =res; p != NULL;p = p->ai_next){
        struct sockaddr *ip = p->ai_addr;
        if(p->ai_family == AF_INET){
            struct sockaddr_in *socketTagV4 = (struct sockaddr_in*) ip;
            struct in_addr ipV4 = socketTagV4->sin_addr;
            char *strIP = inet_ntoa(ipV4);
            printf("IPV4,ip = %s \n",strIP);
        }
    }

    return 0;
}

